Imports System.IO

Partial Class captcha
    Inherits System.Web.UI.UserControl

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not IsPostBack() Then
            Session("CaptchaImageText") = MasterCms.CTools.GenerateRandomCode()
        End If
    End Sub

    Sub CaptchaOk(ByVal source As Object, ByVal args As System.Web.UI.WebControls.ServerValidateEventArgs)
        args.IsValid = texCaptcha.Text = Session("CaptchaImageText")
    End Sub
End Class
